package edu.uwm.capstone.diasmart.types;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class EntryContext {
	private Context context;
	private SharedPreferences prefs;

	public EntryContext(Context context) {
		this(context, null);
	}

	public EntryContext(Context context,
			SharedPreferences prefs) {
		this.context = context;
		this.prefs = prefs;
	}

	public Context getContext() {
		return this.context;
	}

	public SharedPreferences getPreferences() {
		if (this.prefs == null)
			this.prefs = PreferenceManager
					.getDefaultSharedPreferences(this.context);
		return this.prefs;
	}
}
